<template>
  <div class="login">
    <el-button type="primary" @click="loginClick">
      登录
    </el-button>
  </div>
</template>
<script setup>
import { ref } from 'vue';
import { login } from '@/api/user'
const userInfo = ref({
  username: 'admin',
  password: '123456',
})
const loginClick = () => {
  let data = userInfo.value
  login(data).then((res) => {
    console.log(res);
  })
}
</script>
<route lang="yaml">
  meta:
    layout: login #对应布局配制文件名
</route>
<style lang="scss" scoped>
div{
  border: 2px solid ;
  p{
    color: red;
  }
}
</style>